#ifndef UTHVALUE_H_
#define UTHVALUE_H_

#define foreach BOOST_FOREACH

#include <iostream>
#include <sstream>
#include <string.h>
#include <stdlib.h>

using namespace std;

namespace phnq
{
	namespace uth
	{
		enum
		{
			UTH_VALUE_TYPE_OBJECT,
			UTH_VALUE_TYPE_ARRAY,
			UTH_VALUE_TYPE_STRING,
			UTH_VALUE_TYPE_NUMBER,
			UTH_VALUE_TYPE_UNDEFINED,
			UTH_VALUE_TYPE_NULL,
			UTH_VALUE_TYPE_FUNCTION
		};
	
		class UTHValue
		{
			public:
				virtual ~UTHValue();
				void retain();
				void release();
				int getType() {return type;};
				bool isObject();
				bool isFunction();
				bool isArray();
				bool isString();
				bool isNumber();
				bool isUndefined();
				bool isNull();
				string toString();
				virtual void serialize(stringbuf *sb) = 0;
				virtual bool equals(UTHValue *val);
				virtual int hash();
		
			protected:
				UTHValue(unsigned int type);
		
			private:
				unsigned int type;
				unsigned int retainCount;
		};
	}
}

#endif //UTHVALUE_H_
